package com.gckj.dfds.backup;

/**
 * @description: 主启动类
 * @Author liu Weidong
 * @Email:
 * @Date: 2024/5/6 9:40
 * @Version 1.0
 */
public class BackUpNode {

    private boolean isRunning = true;

    private FSNamesystem fsNamesystem;

    private NameNodeClientRpc nameNodeClientRpc;

    public static void main(String[] args) throws Exception {
        BackUpNode backUpNode = new BackUpNode();
        backUpNode.init();
        backUpNode.start();
    }

    private void init(){
        this.fsNamesystem = new FSNamesystem();
        this.nameNodeClientRpc = new NameNodeClientRpc();
    }

    private void start() {
        FetchLogTrailer fetchLogTrailer = new FetchLogTrailer(this,fsNamesystem,this.nameNodeClientRpc);
        FSImageCheckPointer fsImageCheckPointer = new FSImageCheckPointer(this, fsNamesystem, nameNodeClientRpc);
        fetchLogTrailer.start();
        fsImageCheckPointer.start();
    }


    public boolean isRunning() {
        return isRunning;
    }

    public void setRunning(boolean running) {
        isRunning = running;
    }
}
